export function checkIsFull16(idcard) {
  const birthday = idcard.substr(6, 8)
  const year = Number(birthday.substr(0, 4))
  const month = Number(birthday.substr(4, 2))
  const day = Number(birthday.substr(6, 2))
  const date = new Date()
  const currentYear = date.getFullYear()
  const currentMonth = Number(date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1)
  const currentDay = Number(date.getDate() < 10 ? '0' + date.getDate() : date.getDate())

  if ((currentYear - year) >= 17) {
    return true
  }
  if ((currentYear - year) < 16) {
    return false
  }
  if (currentMonth === month) {
    return currentDay > day
  }
  return currentMonth > month
}

export function checkName(name) {
  return /^[\u4e00-\u9fa5]+[.·]?[\u4e00-\u9fa5]+$/.test(name)
}
